package com.hp.service.impl;

import com.github.pagehelper.PageHelper;
import com.hp.entity.*;
import com.hp.mapper.UserMapper;
import com.hp.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class UserServiceImpl implements UserService {
    @Resource
    private UserMapper userMapper;

    @Override
    public User login(User user) {
        return userMapper.login(user);
    }

    @Override
    public List<Permissions> getPermissions(Integer id) {
        return userMapper.getPermissions(id);
    }

    @Override
    public void saveLog(LoginInfor log) {

    }

    @Override
    public List<Role> getAllRole() {
        return userMapper.getAllRole();
    }

    @Override
    public List<User> findAll(User user, Integer page, Integer limit) {
        return userMapper.findAll(user);
    }

    @Override
    public User findById(User user) {
        return userMapper.findById(user);
    }

    @Override
    public int add(Patient patient) {
        return userMapper.add(patient);
    }

    @Override
    public int delete(User user) {
        return userMapper.delete(user);
    }

    @Override
    public List<User> selectAll(String email, Integer limit, Integer page) {
        return userMapper.selectAll(email);
    }

    @Override
    public List<User> findAlle(String email) {
        return userMapper.findAlle(email);
    }

    @Override
    public int update(User user) {
        return userMapper.update(user);
    }

    @Override
    public User findAlltow(String email) {
        return userMapper.findAlltow(email);
    }

    @Override
    public int updatetow(User user) {
        return userMapper.updatetow(user);
    }

    @Override
    public List<User> addfind(String email) {
        return userMapper.addfind(email);
    }

    @Override
    public List<Role> selectrole() {
        return userMapper.selectrole();
    }

    @Override
    public int add1(UserRole userRole) {
        return userMapper.add1(userRole);
    }

}
